home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume7 / xdm / patch1.01 next >
Encoding:
Internet Message Format  |  1990-06-08  |  19.3 KB

  1. Path: uunet!mailrus!cs.utexas.edu!texbell!texsun!newstop!sun!ultima.cs.uts.oz.au
  2. From: keane@ultima.cs.uts.oz.au (Chris Keane)
  3. Newsgroups: comp.sources.x
  4. Subject: v07i087: xdm, Patch1, Part01/02
  5. Message-ID: <136910@sun.Eng.Sun.COM>
  6. Date: 8 Jun 90 17:40:41 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 654
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: keane@ultima.cs.uts.oz.au (Chris Keane)
  12. Posting-number: Volume 7, Issue 87
  13. Archive-name: xdm/patch1.01
  14.  
  15. Here are the diffs to xdm to put a console window up (so console messages
  16. don't destroy the screen). Please note that these are in no way official
  17. patches to xdm! Use them at your own risk! These diffs should be unpacked
  18. in ...mit/clients/xdm and applied with:
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of shell archive."
  27. # Contents:  README.console get_pty.c makeconsole.c patch1 xdmconsole.c
  28. #   xdmconsole.h
  29. # Wrapped by keane@zeus on Fri Jun  8 16:32:36 1990
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'README.console' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'README.console'\"
  33. else
  34. echo shar: Extracting \"'README.console'\" \(3059 characters\)
  35. sed "s/^X//" >'README.console' <<'END_OF_FILE'
  36. X
  37. X
  38. XHere are the diffs to xdm to put a console window up (so console messages
  39. Xdon't destroy the screen). Please note that these are in no way official
  40. Xpatches to xdm! Use them at your own risk! These diffs should be unpacked
  41. Xin ...mit/clients/xdm and applied with:
  42. X
  43. Xmake Makefile
  44. Xmake
  45. X
  46. XThese diffs have been tested on Sun3, Sun386i and sunSS1 workstations all
  47. Xrunning SunOS 4.0.x. The diffs have been tested under X11r3 and X11r4, although
  48. Xonly the diffs for X11r4 are included here. If you need the X11r3 stuff, I
  49. Xspose I can hack a copy out, but the diffs are so small you should be able to do
  50. Xit yourself.
  51. X
  52. XThis new version creates an application called xdmconsole. All it really
  53. Xdoes it display any text that it reads from stdin. This window is created
  54. Xwhen the xdm Login widget appears. The window persists throughout a user's
  55. Xsession (unless the silly fool kills it :-). The window is destroyed at the
  56. Xend of a user's session and is re-created when the Login widget re-appears.
  57. XThere is a tiny period between the xdm-reset and the arrival of the Login
  58. Xwidget in which messages to the console will actually appear on the console...
  59. XI thought about it and can't think of any nice ways of fixing it, the 
  60. Xproblem isn't major (I've never seen it happen), so I didn't worry. 
  61. X
  62. XThe patch to xdm basically allows for the creation of the tty/pty pair
  63. Xthat becomes the new console (this happens in dm.c), the hijack of the
  64. Xconsole output (using ioctl with TIOCCONS, the console is re-assigned to
  65. Xthe tty of the tty/pty pair), the re-assignment of stdin to the pty side
  66. Xof the pair and the creation of the xdmconsole process (that, suprise,
  67. Xsuprise, reads from stdin which just now happens to be the pty) (all this 
  68. Xhappens in makeconsole.c, get_pty.c and is called from session.c)
  69. X
  70. XThe code to get a pty/tty pair was lifted wholesale from xterm.
  71. X
  72. XBe warned! The code for this (esp. the X stuff) is exceedingly bad. Rather
  73. Xshameful might be more accurate (c'mon, it was my 2nd attempt at XLib
  74. Xprogramming). I hadn't even heard of the X toolkit when I first wrote this
  75. Xcode, and don't expect to be able to set any resources either.
  76. XAlso, be careful of changing anything! The text printing in the window
  77. Xrelies on the text being a certain size (puke :-),  and, in fact, the 
  78. Xwindow being a certain size as well.  The current setting places the
  79. Xwindow in the horizontal middle of your screen, with about a 30 pixel gap
  80. Xbetween the bottom of the window and the bottom of the screen.
  81. X
  82. XAlso, you will have to set
  83. X
  84. XDisplayManager*grabServer:    false
  85. X
  86. Xin .../xdm/xdm-config, otherwise the window simply won't be able to appear
  87. Xuntil the user actually logs in, which rather defeats the purpose :-)
  88. X
  89. XAll in all, though, it doesn't look TOO bad. One day I may even get around
  90. Xto making it really nice, but please be aware that I'll only provide
  91. Xminimal support for it.
  92. X
  93. Xregards...
  94. X                    Chris Keane.
  95. X                    Glorified Laboratory Attendant,
  96. X                    University of Technology, Sydney.
  97. X                    keane@ultima.cs.uts.oz.au
  98. X                    or is it keane@ultima.socs.uts.edu.au?
  99. X                    I can never remember.
  100. X
  101. END_OF_FILE
  102. if test 3059 -ne `wc -c <'README.console'`; then
  103.     echo shar: \"'README.console'\" unpacked with wrong size!
  104. fi
  105. # end of 'README.console'
  106. fi
  107. if test -f 'get_pty.c' -a "${1}" != "-c" ; then 
  108.   echo shar: Will not clobber existing file \"'get_pty.c'\"
  109. else
  110. echo shar: Extracting \"'get_pty.c'\" \(1387 characters\)
  111. sed "s/^X//" >'get_pty.c' <<'END_OF_FILE'
  112. X#include "ptyx.h"
  113. X#include <stdio.h>
  114. X
  115. Xextern char *ttydev;
  116. Xextern char *ptydev;
  117. X
  118. Xget_pty (pty)
  119. Xint *pty;
  120. X{
  121. X        static int devindex, letter = 0;
  122. X
  123. X
  124. X        ttydev = (char *) malloc (strlen (TTYDEV) + 1);
  125. X        ptydev = (char *) malloc (strlen (PTYDEV) + 1);
  126. X        if (!ttydev || !ptydev) {
  127. X            fprintf (stderr,
  128. X                     "cons:  unable to allocate memory for ttydev or ptydev\n");
  129. X            return (1);
  130. X        }
  131. X        strcpy (ttydev, TTYDEV);
  132. X        strcpy (ptydev, PTYDEV);
  133. X
  134. X
  135. X        while (PTYCHAR1[letter]) {
  136. X            ttydev [strlen(ttydev) - 2]  = ptydev [strlen(ptydev) - 2] =
  137. X                    PTYCHAR1 [letter];
  138. X
  139. X            while (PTYCHAR2[devindex]) {
  140. X                ttydev [strlen(ttydev) - 1] = ptydev [strlen(ptydev) - 1] =
  141. X                        PTYCHAR2 [devindex];
  142. X                if ((*pty = open (ptydev, O_RDWR)) >= 0) {
  143. X                        /* We need to set things up for our next entry
  144. X                         * into this function!
  145. X                         */
  146. X                        (void) devindex++;
  147. X                        return(0);
  148. X                }
  149. X                devindex++;
  150. X            }
  151. X            devindex = 0;
  152. X            (void) letter++;
  153. X        }
  154. X        /* We were unable to allocate a pty master!  Return an error
  155. X         * condition and let our caller terminate cleanly.
  156. X         */
  157. X        return(1);
  158. X}
  159. END_OF_FILE
  160. if test 1387 -ne `wc -c <'get_pty.c'`; then
  161.     echo shar: \"'get_pty.c'\" unpacked with wrong size!
  162. fi
  163. # end of 'get_pty.c'
  164. fi
  165. if test -f 'makeconsole.c' -a "${1}" != "-c" ; then 
  166.   echo shar: Will not clobber existing file \"'makeconsole.c'\"
  167. else
  168. echo shar: Extracting \"'makeconsole.c'\" \(835 characters\)
  169. sed "s/^X//" >'makeconsole.c' <<'END_OF_FILE'
  170. X#include <fcntl.h>
  171. X#include <sys/termios.h>
  172. X#include <sys/wait.h>
  173. X#define FONT "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1"
  174. X#include "xdmconsole.h"
  175. X#define PTYPROC "/usr/bin/X11/xdmconsole"
  176. X
  177. Xchar *ttydev;
  178. Xchar *ptydev;
  179. X
  180. Xextern int tty, pty;
  181. X
  182. X
  183. Xint getttys()
  184. X{
  185. X    if ((get_pty(&pty)) != 0) return(-1);
  186. X    if ((tty=open(ttydev, O_RDWR, 0)) < 0)
  187. X    {
  188. X        return(-1);
  189. X    }
  190. X    return(0);
  191. X}
  192. X
  193. X
  194. X
  195. Xint make_console()
  196. X{
  197. X    int childpid;
  198. X
  199. X    if ((childpid=fork())==0)
  200. X    {
  201. X        close(0);
  202. X        dup(pty);
  203. X
  204. X        execl(PTYPROC, "console", 0);
  205. X    }
  206. X    if (ioctl(tty, TIOCCONS, 0) < 0)
  207. X    {
  208. X        return(-1);
  209. X    }
  210. X    return(childpid);
  211. X}
  212. X
  213. Xint kill_console(childpid)
  214. Xint childpid;
  215. X{
  216. X
  217. X/*
  218. X    if (childpid > 20)
  219. X        if (kill(childpid, 9) != -1)
  220. X            if (wait((union wait *) 0) == -1)
  221. X                perror("console");
  222. X  for some reason, this seems to kill xdm totally sometimes (about 1 in 50)
  223. X*/
  224. X
  225. X}
  226. END_OF_FILE
  227. if test 835 -ne `wc -c <'makeconsole.c'`; then
  228.     echo shar: \"'makeconsole.c'\" unpacked with wrong size!
  229. fi
  230. # end of 'makeconsole.c'
  231. fi
  232. if test -f 'patch1' -a "${1}" != "-c" ; then 
  233.   echo shar: Will not clobber existing file \"'patch1'\"
  234. else
  235. echo shar: Extracting \"'patch1'\" \(9035 characters\)
  236. sed "s/^X//" >'patch1' <<'END_OF_FILE'
  237. X*** Imakefile    Fri Jun  8 15:51:50 1990
  238. X--- Imakefile    Fri Jun  1 12:02:59 1990
  239. X***************
  240. X*** 27,43 ****
  241. X            SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c \
  242. X            file.c greet.c reset.c resource.c protodpy.c policy.c \
  243. X            session.c socket.c util.c verify.c Login.c mitauth.c \
  244. X!           cryptokey.c $(DESSRCS)
  245. X            OBJS1 = auth.o daemon.o server.o dpylist.o dm.o error.o \
  246. X            file.o greet.o reset.o resource.o protodpy.o policy.o \
  247. X            session.o socket.o util.o verify.o Login.o mitauth.o \
  248. X!           cryptokey.o $(DESOBJS)
  249. X            SRCS2 = xdmshell.c 
  250. X            OBJS2 = xdmshell.o 
  251. X            SRCS4 = sessreg.c
  252. X            OBJS4 = sessreg.o
  253. X!        PROGRAMS = xdm xdmshell sessreg
  254. X  
  255. X  #if !HasVoidSignalReturn
  256. X       SIGDEFS = -DSIGNALRETURNSINT
  257. X  #endif
  258. X--- 27,46 ----
  259. X            SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c \
  260. X            file.c greet.c reset.c resource.c protodpy.c policy.c \
  261. X            session.c socket.c util.c verify.c Login.c mitauth.c \
  262. X!           cryptokey.c get_pty.c makeconsole.c $(DESSRCS)
  263. X            OBJS1 = auth.o daemon.o server.o dpylist.o dm.o error.o \
  264. X            file.o greet.o reset.o resource.o protodpy.o policy.o \
  265. X            session.o socket.o util.o verify.o Login.o mitauth.o \
  266. X!           cryptokey.o get_pty.o makeconsole.o $(DESOBJS)
  267. X            SRCS2 = xdmshell.c 
  268. X            OBJS2 = xdmshell.o 
  269. X            SRCS4 = sessreg.c
  270. X            OBJS4 = sessreg.o
  271. X!       SRCS3 = xdmconsole.c xroutines.c
  272. X!       OBJS3 = xdmconsole.o xroutines.o
  273. X  
  274. X+        PROGRAMS = xdm xdmshell sessreg xdmconsole
  275. X+ 
  276. X  #if !HasVoidSignalReturn
  277. X       SIGDEFS = -DSIGNALRETURNSINT
  278. X  #endif
  279. X***************
  280. X*** 68,73 ****
  281. X--- 71,77 ----
  282. X            '-DCPP_PROGRAM="$(CPP_PROGRAM)"'
  283. X  
  284. X  ComplexProgramTarget_1(xdm,$(LOCAL_LIBRARIES), /**/)
  285. X+ ComplexProgramTarget_3(xdmconsole,$(XLIB), /**/)
  286. X  SingleProgramTarget(xdmshell,$(OBJS2), /**/, /**/)
  287. X  SingleProgramTarget(sessreg,$(OBJS4), /**/, /**/)
  288. X  
  289. X*** Makefile    Fri Jun  8 15:51:51 1990
  290. X--- Makefile    Fri Jun  8 15:14:15 1990
  291. X***************
  292. X*** 82,88 ****
  293. X  
  294. X            DESTDIR =
  295. X  
  296. X!      TOP_INCLUDES = -I$(TOP)
  297. X  
  298. X        CDEBUGFLAGS = -O
  299. X          CCOPTIONS =
  300. X--- 82,88 ----
  301. X  
  302. X            DESTDIR =
  303. X  
  304. X!      TOP_INCLUDES = -I$(INCROOT)
  305. X  
  306. X        CDEBUGFLAGS = -O
  307. X          CCOPTIONS =
  308. X***************
  309. X*** 101,108 ****
  310. X  
  311. X      IMAKE_DEFINES =
  312. X  
  313. X!          IRULESRC = $(CONFIGSRC)
  314. X!         IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
  315. X  
  316. X       ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  317. X              $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  318. X--- 101,108 ----
  319. X  
  320. X      IMAKE_DEFINES =
  321. X  
  322. X!          IRULESRC = $(CONFIGDIR)
  323. X!         IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  324. X  
  325. X       ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  326. X              $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  327. X***************
  328. X*** 152,163 ****
  329. X  
  330. X       INSTAPPFLAGS = $(INSTDATFLAGS)
  331. X  
  332. X!             IMAKE = $(IMAKESRC)/imake
  333. X!            DEPEND = $(DEPENDSRC)/makedepend
  334. X!               RGB = $(RGBSRC)/rgb
  335. X!             FONTC = $(BDFTOSNFSRC)/bdftosnf
  336. X!         MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
  337. X!         MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
  338. X  
  339. X          CONFIGSRC = $(TOP)/config
  340. X          CLIENTSRC = $(TOP)/clients
  341. X--- 152,163 ----
  342. X  
  343. X       INSTAPPFLAGS = $(INSTDATFLAGS)
  344. X  
  345. X!             IMAKE = imake
  346. X!            DEPEND = makedepend
  347. X!               RGB = rgb
  348. X!             FONTC = bdftosnf
  349. X!         MKFONTDIR = mkfontdir
  350. X!         MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  351. X  
  352. X          CONFIGSRC = $(TOP)/config
  353. X          CLIENTSRC = $(TOP)/clients
  354. X***************
  355. X*** 185,220 ****
  356. X       MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  357. X       EXTENSIONSRC = $(TOP)/extensions
  358. X  
  359. X!   DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  360. X       EXTENSIONLIB =  -lXext
  361. X  
  362. X!           DEPXLIB = $(DEPEXTENSIONLIB)
  363. X               XLIB = $(EXTENSIONLIB) -lX11
  364. X  
  365. X!       DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
  366. X!          XAUTHLIB =  $(DEPXAUTHLIB)
  367. X  
  368. X          DEPXMULIB =
  369. X!            XMULIB = -L$(XMUSRC) -lXmu
  370. X  
  371. X         DEPOLDXLIB =
  372. X!           OLDXLIB = -L$(OLDXLIBSRC) -loldX
  373. X  
  374. X        DEPXTOOLLIB =
  375. X!          XTOOLLIB = -L$(TOOLKITSRC) -lXt
  376. X  
  377. X          DEPXAWLIB =
  378. X!            XAWLIB = -L$(AWIDGETSRC) -lXaw
  379. X  
  380. X!  LINTEXTENSIONLIB = $(EXTENSIONSRC)/lib/llib-lXext.ln
  381. X!          LINTXLIB = $(XLIBSRC)/llib-lX11.ln
  382. X!           LINTXMU = $(XMUSRC)/llib-lXmu.ln
  383. X!         LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
  384. X!           LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
  385. X  
  386. X          XWLIBSRC = $(CONTRIBSRC)/toolkits/Xw
  387. X!         DEPXWLIB = $(XWLIBSRC)/libXw.a
  388. X!         XWLIB =  $(DEPXWLIB)
  389. X  
  390. X            DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  391. X  
  392. X--- 185,220 ----
  393. X       MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  394. X       EXTENSIONSRC = $(TOP)/extensions
  395. X  
  396. X!   DEPEXTENSIONLIB = 
  397. X       EXTENSIONLIB =  -lXext
  398. X  
  399. X!           DEPXLIB =
  400. X               XLIB = $(EXTENSIONLIB) -lX11
  401. X  
  402. X!       DEPXAUTHLIB = 
  403. X!          XAUTHLIB =  -lXau
  404. X  
  405. X          DEPXMULIB =
  406. X!            XMULIB = -lXmu
  407. X  
  408. X         DEPOLDXLIB =
  409. X!           OLDXLIB = -loldX
  410. X  
  411. X        DEPXTOOLLIB =
  412. X!          XTOOLLIB = -lXt
  413. X  
  414. X          DEPXAWLIB =
  415. X!            XAWLIB = -lXaw
  416. X  
  417. X!  LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  418. X!          LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  419. X!           LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  420. X!         LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  421. X!           LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  422. X  
  423. X          XWLIBSRC = $(CONTRIBSRC)/toolkits/Xw
  424. X!         DEPXWLIB = $(USRLIBDIR)/libXw.a
  425. X!         XWLIB =  -lXw
  426. X  
  427. X            DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  428. X  
  429. X***************
  430. X*** 236,243 ****
  431. X     XDMCONFIGDIR = config/default
  432. X          SUBDIRS = $(XDMCONFIGDIR)
  433. X  
  434. X  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) \
  435. X!           $(TOP)/lib/Xau/libXau.a $(TOP)/lib/Xdmcp/libXdmcp.a $(XLIB)
  436. X            SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c \
  437. X            file.c greet.c reset.c resource.c protodpy.c policy.c \
  438. X            session.c socket.c util.c verify.c Login.c mitauth.c \
  439. X--- 236,245 ----
  440. X     XDMCONFIGDIR = config/default
  441. X          SUBDIRS = $(XDMCONFIGDIR)
  442. X  
  443. X+ DEPLIBS = 
  444. X+      
  445. X  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) \
  446. X!           -lXau -lXdmcp $(XLIB)
  447. X            SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c \
  448. X            file.c greet.c reset.c resource.c protodpy.c policy.c \
  449. X            session.c socket.c util.c verify.c Login.c mitauth.c \
  450. X***************
  451. X*** 296,308 ****
  452. X  install.man:: xdm.man
  453. X      $(INSTALL) -c $(INSTMANFLAGS) xdm.man $(MANDIR)/xdm.n
  454. X  
  455. X- depend:: $(DEPEND)
  456. X- 
  457. X- $(DEPEND):
  458. X-     @echo "checking $@ over in $(DEPENDSRC) first..."; \
  459. X-     cd $(DEPENDSRC); $(MAKE); \
  460. X-     echo "okay, continuing in $(CURRENT_DIR)"
  461. X- 
  462. X  depend::
  463. X      $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  464. X  
  465. X--- 298,303 ----
  466. X***************
  467. X*** 349,363 ****
  468. X  
  469. X  clean::
  470. X      $(RM_CMD) \#*
  471. X- 
  472. X- Makefile:: $(IMAKE)
  473. X- 
  474. X- $(IMAKE):
  475. X-     @(cd $(IMAKESRC); if [ -f Makefile ]; then \
  476. X-     echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \
  477. X-     echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \
  478. X-     $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
  479. X-     echo "okay, continuing in $(CURRENT_DIR)")
  480. X  
  481. X  Makefile::
  482. X      -@if [ -f Makefile ]; then \
  483. X--- 344,349 ----
  484. X*** dm.c    Fri Jun  8 15:51:52 1990
  485. X--- dm.c    Fri Jun  1 11:17:13 1990
  486. X***************
  487. X*** 45,50 ****
  488. X--- 45,51 ----
  489. X  static SIGVAL    StopAll (), RescanNotify ();
  490. X  void        StopDisplay ();
  491. X  static void    RestartDisplay ();
  492. X+ int         tty, pty;
  493. X  
  494. X  #ifndef NOXDMTITLE
  495. X  static char *Title;
  496. X***************
  497. X*** 81,86 ****
  498. X--- 82,91 ----
  499. X      }
  500. X      if (debugLevel == 0 && daemonMode)
  501. X          BecomeDaemon ();
  502. X+     /*
  503. X+      *  grab the console so no messages go there    
  504. X+      */
  505. X+     getttys();
  506. X      if (oldpid = StorePid ())
  507. X      {
  508. X      if (oldpid == -1)
  509. X*** session.c    Fri Jun  8 15:51:54 1990
  510. X--- session.c    Fri Jun  1 11:17:15 1990
  511. X***************
  512. X*** 96,106 ****
  513. X--- 96,112 ----
  514. X      exit(UNMANAGE_DISPLAY);
  515. X  }
  516. X  
  517. X+ 
  518. X+ /* import the tty/pty pair from where they were initialised...Chris */
  519. X+ extern int tty, pty;
  520. X+ 
  521. X+ 
  522. X  ManageSession (d)
  523. X  struct display    *d;
  524. X  {
  525. X      int            pid;
  526. X      Display        *dpy, *InitGreet ();
  527. X+     int            childpid;
  528. X  
  529. X      Debug ("ManageSession %s\n", d->name);
  530. X      (void)XSetIOErrorHandler(IOErrorHandler);
  531. X***************
  532. X*** 112,117 ****
  533. X--- 118,127 ----
  534. X      LoadXloginResources (d);
  535. X      Debug ("name now %s\n", d->name);
  536. X      dpy = InitGreet (d);
  537. X+     /*
  538. X+      * Step 5a: put up a console window...Chris. 
  539. X+      */
  540. X+     childpid=make_console();
  541. X      if (d->authorization && d->authFile)
  542. X      {
  543. X      Debug ("Done with authorization file %s, removing\n", d->authFile);
  544. X***************
  545. X*** 194,199 ****
  546. X--- 204,213 ----
  547. X       */
  548. X      Debug ("Source reset program %s\n", d->reset);
  549. X      source (&verify, d->reset);
  550. X+     /*
  551. X+      * make sure that the console got nuked along with everything else...Chris.
  552. X+      */
  553. X+     kill_console(childpid);
  554. X      SessionExit (d, OBEYSESS_DISPLAY);
  555. X  }
  556. X  
  557. END_OF_FILE
  558. if test 9035 -ne `wc -c <'patch1'`; then
  559.     echo shar: \"'patch1'\" unpacked with wrong size!
  560. fi
  561. # end of 'patch1'
  562. fi
  563. if test -f 'xdmconsole.c' -a "${1}" != "-c" ; then 
  564.   echo shar: Will not clobber existing file \"'xdmconsole.c'\"
  565. else
  566. echo shar: Extracting \"'xdmconsole.c'\" \(1046 characters\)
  567. sed "s/^X//" >'xdmconsole.c' <<'END_OF_FILE'
  568. X#include <fcntl.h>
  569. X#define FONT "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1"
  570. X#include "xdmconsole.h"
  571. X
  572. Xint win_err(disp, errorcode)
  573. XDisplay *disp;
  574. XXErrorEvent *errorcode;
  575. X{
  576. X    /*  Some obscure old event  */
  577. X    exit(0);
  578. X}
  579. Xint naughty_win_err(disp)
  580. XDisplay *disp;
  581. X{
  582. X    /*  Window not currently in existance  */
  583. X    exit(0);
  584. X}
  585. X
  586. Xextern int screen;
  587. Xextern Display *disp;
  588. X
  589. Xmain()
  590. X{
  591. X    char buf[128];
  592. X    int size=0;
  593. X    int inc;
  594. X    char *name, stdprint[80];
  595. X
  596. X    
  597. X    initwin(400, 70, Place, Place, 3, Transient, "Console");
  598. X    winfont(FONT);
  599. X    inc = 15;
  600. X    wincursor(XC_gumby);
  601. X    winevents(ExposureMask);
  602. X    showwin();
  603. X    name = (char *) malloc(64);
  604. X    if (gethostname(name, 64) != -1)
  605. X    {
  606. X        strcpy(stdprint, name);
  607. X    }
  608. X    strcat(stdprint, " console.");
  609. X    winprint(2,15, stdprint);
  610. X
  611. X    XSetErrorHandler(win_err);
  612. X    XSetIOErrorHandler(naughty_win_err);
  613. X
  614. X    
  615. X    for(;;)
  616. X    {
  617. X        if ((size=read(0, buf, sizeof(buf))) > 0);
  618. X        {
  619. X            buf[size]='\0';
  620. X            if (inc > 59)
  621. X            {
  622. X                inc -= 15;
  623. X                scrollup(15);
  624. X            }
  625. X            inc += 15;
  626. X            winwrapprint(2, inc, buf, 15);
  627. X            buf[0]='\0';
  628. X            size=0;
  629. X        }
  630. X    }
  631. X}
  632. X
  633. END_OF_FILE
  634. if test 1046 -ne `wc -c <'xdmconsole.c'`; then
  635.     echo shar: \"'xdmconsole.c'\" unpacked with wrong size!
  636. fi
  637. # end of 'xdmconsole.c'
  638. fi
  639. if test -f 'xdmconsole.h' -a "${1}" != "-c" ; then 
  640.   echo shar: Will not clobber existing file \"'xdmconsole.h'\"
  641. else
  642. echo shar: Extracting \"'xdmconsole.h'\" \(168 characters\)
  643. sed "s/^X//" >'xdmconsole.h' <<'END_OF_FILE'
  644. X#define Transient 1
  645. X#define Managed 0
  646. X#define Place -1
  647. X#include <X11/cursorfont.h>
  648. X#include <strings.h>
  649. X#include <X11/Xlib.h>
  650. X#include <X11/Xutil.h>
  651. X#include <stdio.h>
  652. END_OF_FILE
  653. if test 168 -ne `wc -c <'xdmconsole.h'`; then
  654.     echo shar: \"'xdmconsole.h'\" unpacked with wrong size!
  655. fi
  656. # end of 'xdmconsole.h'
  657. fi
  658. echo shar: End of shell archive.
  659. exit 0
  660.  
  661. dan
  662. ----------------------------------------------------
  663. O'Reilly && Associates   argv@sun.com / argv@ora.com
  664. Opinions expressed reflect those of the author only.
  665.